package com.citicpub_cloud.restfull.utils;


import javax.servlet.http.HttpSession;

import com.citicpub_cloud.restfull.api.dto.TbAdminAccountExt;
import com.citicpub_cloud.restfull.common.constant.AdminUserConstant;


public class SessionUtils {

    /**
     * 获取 session中的uid
     * @param session
     * @return
     */
    public static String getUid(HttpSession session){
        Object obj = session.getAttribute(AdminUserConstant.SessionConstant.SESSION_ATTR_NAME);
        if(null!=obj){
        	TbAdminAccountExt sessionUserInfo = (TbAdminAccountExt) obj;
            return sessionUserInfo.getUid();
        }
        return "123";
       // return null;
    }
    
  
    /**
     * @desccroption:后台用户session key 生成
     * @param redisSessionName
     * @param uid
     * @param token
     * @return
     * String
     */
    public static String getRedisSessionKeyForAdmin(String redisSessionName,String uid,String token){
        return redisSessionName+uid+token;
    }
}
